/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wakawakathistimeforafrica;

import java.util.logging.Level;
import java.util.logging.Logger;
import wakawakathistimeforafrica.ihm.MainForm;
import wakawakathistimeforafrica.model.Client;
import wakawakathistimeforafrica.tools.ArffReader;
import wakawakathistimeforafrica.tools.ModelGenerator;
import wakawakathistimeforafrica.tools.ModelRequester;
import weka.core.Instance;

/**
 *
 * @author Jissay
 */
public class WAKAWAKATHISTIMEFORAFRICA {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
        try 
        {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        
            
            //ArffReader arff = new ArffReader();
            /*ModelGenerator m_generator = new ModelGenerator();
            m_generator.generateModel();
            
            ModelRequester m_requester = new ModelRequester(m_generator.getcModel(), m_generator.getInstancesSet());
            m_requester.requestModel();*/
            
            //ArffReader arff = new ArffReader();
            final ModelGenerator m_generator = new ModelGenerator();
            m_generator.generateModel();
            
            //ModelRequester m_requester = new ModelRequester(m_generator.getcModel(), m_generator.getInstancesSet());
            //Client client = new Client(m_generator.getInstancesSet());
            
            java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                    new MainForm(m_generator.getInstancesSet()).setVisible(true);
                }
            });
            
            
            // TODO: Check le format des attributes à chaque fois la valeur DOIT exister dans le pool de valeurs de l'attribut....... 
//            Client client = new Client(m_generator.getInstancesSet(), "<0", 1.0f, "all paid", "radio/tv", 2.0f, "<100", "unemployed", 3.0f, "male single", "none", 4.0f, "car", 5.0f, "none", "own", 6.0f, "skilled", 7.0f, "none", "yes");
//            Instance inst = client.getCurrentInstance();
//            System.out.println("CLIENT ::: " + inst.toString());
//            System.out.println("CLASSIFIED VALUE ::: " + m_requester.requestModelForInstance(inst, m_generator.getInstancesSet()));
//        
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(WAKAWAKATHISTIMEFORAFRICA.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
